package sqlTestes.tColuna;

import junit.framework.Assert;

import org.junit.Test;

import sql.ddl.PrimaryKey;
import sql.ddl.Tabela;
import sql.ddl.coluna.ColunaComposta;
import sql.ddl.coluna.ListaColuna;

public class TesteColunaComposta {
	@Test
	public void testarNomeColunasSendo2PrimaryDeOutrasTabelas() throws Exception {
		Tabela agua = new Tabela("Agua", true);
		ColunaComposta a = new ColunaComposta(agua, "a");
		ColunaComposta ab = new ColunaComposta(agua, "ab");
		ListaColuna l = new ListaColuna();
		l.add(a);
		l.add(ab);
		PrimaryKey pk = new PrimaryKey(l);
		Assert.assertEquals("PRIMARY KEY(fkA," + "fkAb)", pk
				.codigoSQL());

	}

}
